package lab5p2;

/**
 * <p>Title: PlayingCard</p>
 * <p>Description: CS 235 Assignment #1</p>
 * 
 * This class is used to represent a single playing card.
 * The class is immutable, and so therefore has no mutator 
 * methods, only an overloaded constructor to initialize the 
 * object, and a toString method used to display the object state.
 * 
 * @author Nick Brown
 * @email nicholas.brown@my.uwrf.edu
 * @date February 25th 2013
 */

public class PlayingCard 
{
	// Data members for rank and suit.
	private Rank rank;
	private Suit suit;
		
	// Constructor with parameters of enumerated types Rank and Suit.
	public PlayingCard(Rank r, Suit s)
	{
		rank = r;
		suit = s;
	}

	// Simple method used to display the object state.
	public String toString()
	{
		return rank + " of " + suit;
	}
	
	// simple compare method to see if the rank of another card is
	//    the same  - return 0
	//    greater   - return positive number
	//    smaller   - return negative number
	public int compare( PlayingCard other ){
		return rank.compareTo( other.rank );
	}
}
